#pragma once

#include "stdafx.h"
#include "peparse.h"



class CFileImage : public CPEParse
{
public:
    CFileImage(void);
    CFileImage(LPCTSTR lpszFileName);
    virtual ~CFileImage(void);

public:
    VOID SetFile(IN LPCTSTR lpszFile);
    VOID SetFile(IN tstring& strFile);
    BOOL IsFileInitial();

    virtual BOOL PeRead(
        IN ULONGLONG Offset, 
        OUT PVOID Buffer, 
        IN ULONG Length
    );
    
    virtual BOOL PeWrite(
        IN ULONGLONG Offset, 
        IN PVOID Buffer, 
        IN ULONG Length
    );

    virtual BOOL PeOpen();
    virtual VOID PeClose();

private:
    tstring m_strFileName;
    HANDLE m_hFile;
};

